#pragma once

#include "Preferences.h"

struct EditorProfile{
	void serialize(Archive& ar);
	std::string name;
	std::string executable;
	std::string arguments;

	bool operator==(const EditorProfile& rhs){
		return name == rhs.name &&
			executable == rhs.executable &&
			arguments == rhs.arguments;
	}
};

struct Tag;
class EditorPreferences : public PreferencesBlock{
public:
	EditorPreferences();
	void serialize(Archive& ar);
	
	void executeEditor(const Tag& tag);
protected:
	StringList availableEditorsStringList(bool withCustom);
	int editorIndex(const EditorProfile& profile);
	void findAvailableEditors();

	EditorProfile editorProfile_;
	typedef std::vector<EditorProfile> AvailableEditors;
    AvailableEditors availableEditors_;
};

extern EditorPreferences editorPreferences;
